In a wellbore survey in a drillpipe, especially during steering or measure while drilling, a drillpipe could have, in a long horizontal section, significant residual torsion. Residual torsion, as well as other forces on the drill pipe such as rotation during drilling, can lead to rotation of this drillpipe while acquiring survey data. In certain wireline surveys, the surveying tool may rotate about the axis of the wireline. Gyroscopic, magnetic, or accelerometer readings made during surveying may be affected by such rotation, which can affect the accuracy of the survey.